﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace MicroContainer.CompileTime
{
   internal static class ReflectionUtils
   {
      public static IEnumerable<T> GetCustomAttributes<T>(this ICustomAttributeProvider provider, bool inherit)
      {
         object[] attrs = provider.GetCustomAttributes(typeof (T), inherit);
         foreach (T attr in attrs)
         {
            yield return attr;
         }
         yield break;
      }
   }
}
